package com.demo5;

/**
 * Created by Administrator on 2017/3/26.
 */
abstract class Animal4 {
    String type;
    String name;
    int age;
    int weight;

    void eat() {
        System.out.println("animal eat");
    }

    void breath() {
        System.out.println("animal breath");
    }

    void sleep() {
        System.out.println("animal sleep");
    }
}

class Tiger4 extends Animal4 {
    String tigerTyre;
    String from;

    void tigerRun() {
        System.out.println("老虎在奔跑");
    }

    void breath() {
        System.out.println("老虎是用肺呼吸的");
    }

}

class Fish4 extends Animal4 {
    String fishType;

    void swim() {
        System.out.println("鱼在游泳");
    }

    void breath() {
        System.out.println("鱼是用腮呼吸的");
    }
}

public class JiCheng5 {
    public static void main(String[] args) {
        Animal4 animal5=new Fish4();
        animal5.breath();
        Animal4 animal6=new Tiger4();
        animal6.breath();
    }
}
